/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package edu.upn.sigemfi.rec.bc;

import edu.upn.sigemfi.rec.be.AccionCobranza;
import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

/**
 *
 * @author Diego
 */
@Stateless
public class AccionCobranzaFacade implements AccionCobranzaFacadeLocal {
    @PersistenceContext
    private EntityManager em;

    public void create(AccionCobranza accionCobranza) {
        em.persist(accionCobranza);
    }

    public void edit(AccionCobranza accionCobranza) {
        em.merge(accionCobranza);
    }

    public void remove(AccionCobranza accionCobranza) {
        em.remove(em.merge(accionCobranza));
    }

    public AccionCobranza find(Object id) {
        return em.find(AccionCobranza.class, id);
    }

    public List<AccionCobranza> findAll() {
        return em.createQuery("select object(o) from AccionCobranza as o").getResultList();
    }

}
